package com.epam.task.web.dao.impl;

import com.epam.task.web.entity.User;
import com.epam.task.web.entity.Order;

/**
 * User: zhunusbekova.arailym
 */
public interface IEZakaz {
    /**
     * Gets all registered users.
     *
     * @return array of all users. When there are no users, an empty array is
     *         returned. The null value is never returned.
     */
    public User[] getAllUsers();

    /**
     * Gets all on-line users.
     *
     * @return array of on-line users. When there are no users, an empty array is
     *         returned. The null value is never returned.
     */
    public User[] getUsersByStore();

    /**
     * Gets all orders sent to the server.
     *
     * @return array of all orders. When there are no orders, an empty array is
     *         returned. The null value is never returned.
     */
    public Order[] getAllOrders();

    /**
     * Posts new order to the chat server
     *
     * @param order  - the content of the order
     * @param username - the nick name of the posting person
     */
    public void postOrder(String order, String username);

    /**
     * Login user
     *
     * @param username
     * @param password
     * @return 0 - if login is successful, -1 - if login is not successful (wrong name or password,
     *         user is already logged in)
     */
    public int login(String username, String password);

    /**
     * Logout
     *
     * @param username
     * @param password
     * @return 0 - if logout is successful
     */
    public int logout(String username, String password);


}
